package com.example.client.curator;

import com.example.client.ZKConstans;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

/**
 * @author Creared by wangyang on 2019-01-28 18:27
 * email:techyang.wangy.@ymm56.com
 */
public class CreateSessionSample {

    public static void main(String[] args) throws InterruptedException {
        RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
        CuratorFramework curatorFramework = CuratorFrameworkFactory.newClient(ZKConstans.CONNECTOR_STRING,
                 5000, 3000, retryPolicy);
        curatorFramework.start();
        Thread.sleep(Integer.MAX_VALUE);
    }
}
